using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq.Mapping;
using System.Data.Linq;

namespace MimeCloud.AssetManagement.DataProvider.Sql.Entities
{
    [Table(Name="T_AssetContentRepository")]
    internal class AssetContent_Repository
    {
        public AssetContent_Repository()
        {
            _Repository = new EntityRef<Repository>();
            _Content = new EntityRef<AssetContent>();
            StatusID = 0;
        }
        [Column(Name="AssetContentRepository_IDPK",IsPrimaryKey=true,IsDbGenerated=true)]
        public int ID { get; set; }

        [Column(Name="AssetContentID_FK")]
        public int AssetContentID { get; set; }

        [Column(Name = "RepositoryID_FK")]
        public int RepositoryID { get; set; }

        [Column(Name="StatusID_FK")]
        public int StatusID { get; set; }

        [Association(ThisKey="RepositoryID",OtherKey="ID",IsForeignKey=true,Storage="_Repository")]
        public Repository Repository {get{return _Repository.Entity;}set{_Repository.Entity = value;}}
        private EntityRef<Repository> _Repository;
        
        [Association(ThisKey="AssetContentID",OtherKey="ID",IsForeignKey=true,Storage="_Content",DeleteRule="Cascade")]
        public AssetContent Content { get { return _Content.Entity; } set { _Content.Entity = value;}}
        private EntityRef<AssetContent> _Content;
        
    }
}
